package com.woniuxy.movice.util;


import com.alibaba.fastjson.JSON;

public class ConvertUtil {

	public static String convertObjectTOJSON(Object obj) {
		String text = JSON.toJSONString(obj);
		return text;
	}

	public static Integer[][] convertStringTOArrays(String json) {
		String[] s1 = json.replaceAll("],", "]#").split("#");
		Integer[][] arr = new Integer[s1.length][];
		for (int i = 0; i < arr.length; i++) {
			String[] s2 = s1[i].split(",");
			arr[i] = new Integer[s2.length];
			for (int j = 0; j < s2.length; j++) {
				arr[i][j] = Integer.valueOf(s2[j].replaceAll("\\[|\\]", ""));
			}
		}

		return arr;
	}
}
